using System;

namespace AI
{

	public class Neuron
	{
		public static Random random = new Random((int)DateTime.Now.Ticks);

        //=========================================================//
		int numInputs;		// number of inputs
		float[] weights;	// array of weights

		public Neuron(int initNumInputs)
		{
			numInputs = initNumInputs + 1; // + 1 for bias
			weights = new float[numInputs];

			for (int i=0; i<numInputs; i++)
				weights[i] = ((float)(random.NextDouble()) * 2) - 1;
		}

		public float GetNumInputs()
		{
			return numInputs;
		}

		public void SetWeight(int index, float newVal)
		{
			weights[index] = newVal;
		}

		public float GetWeight(int index)
		{
			return weights[index];
		}
	
	}
}
